using System;
using System.Collections.Generic;
using System.Text;


namespace Instedd.Labs.Geo.Library.Sms
{
    internal static class PathResolver
    {
        public static string TryToResolveUsingDataDirectory(string path)
        {
            if (!System.IO.Path.IsPathRooted(path) && AppDomain.CurrentDomain.GetData("DataDirectory") != null)
            {
                return System.IO.Path.Combine(AppDomain.CurrentDomain.GetData("DataDirectory").ToString(), path);
            }

            return path;
        }

        public static string TryToResolveUsingBaseDirectory(string path)
        {
            if (!System.IO.Path.IsPathRooted(path))
            {
                return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
            }

            return path;
        }
    }
}
